home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 42
/
042.d81
/
calorie selector
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
16KB
|
617 lines
100 rem *****************************
110 rem **** disk menu sequence ****
120 rem *****************************
130 rem
140 dim f1$(105)
150 dim f2$(105)
160 dim f3%(105)
170 dim mc$(20)
180 dim m1$(20)
190 dim m2$(20)
200 dim m3%(20)
210 dim mx$(20)
220 ct%=0
230 gosub500
240 rem
250 gosub310
260 goto1310
270 rem
280 rem ** ** ** ** ** ** ** **
290 rem border routine
300 rem ** ** ** ** ** ** ** **
310 print"[147][158]";chr$(142)chr$(8);:poke53280,14:poke53281,0
320 fori=1to38:print"[166][146]";:next
330 fori=1to22:print"[157][166][146]";:next
340 fori=1to37:print"[157][157][166][146]";:next
350 fori=1to22:print"[145][157][166][146]";:next
360 return
370 rem
380 rem ** ** ** ** ** ** ** **
390 rem clear list routine
400 rem ** ** ** ** ** ** ** **
410 print "[147] i am working"
420 for i=1to105
430 f1$(i)="zzz":f2$(i)="z":f3%(i)=0
440 next i
450 return
460 rem
470 rem ** ** ** ** ** ** ** **
480 rem clear menu routine
490 rem ** ** ** ** ** ** ** **
500 for i=1to20
510 mc$(i)="z":m1$(i)="zzz"
520 m2$(i)="x":m3%(i)=0
530 next i
540 ct%=0
550 return
560 rem ** ** ** ** ** ** ** **
570 rem read group in
580 rem ** ** ** ** ** ** ** **
590 print "[147] please wait !!!!!"
600 print "[158]reading ";nf$;"[158] from disk"
610 open15,8,15,"io"
620 gosub1030
630 open5,8,5,"0:"+nf$+",seq,r"
640 gosub1030
650 if en=62 then return
660 for i=1 to 105
670 input#5,f1$(i)
680 gosub1030
690 if f1$(i)="zzz" then goto750
700 input#5,f2$(i)
710 gosub1030
720 input#5,f3%(i)
730 gosub1030
740 next i
750 close5:close15
760 return
770 rem
780 rem ** ** ** ** ** ** ** **
790 rem write group to disk
800 rem ** ** ** ** ** ** ** **
810 print "[147] please wait !!!!!"
820 print "writing ";nf$;" to disk"
830 open15,8,15,"io"
840 gosub1030
850 open5,8,5,"@0:"+nf$+",seq,w"
860 gosub1030
870 for i=1 to 105
880 print#5,f1$(i)
890 gosub1030
900 print#5,f2$(i)
910 gosub1030
920 print#5,f3%(i)
930 gosub1030
940 if f1$="zzz" then goto960
950 next i
960 close5:close15
970 ct%=0
980 return
990 rem
1000 rem ** ** ** ** ** ** ** **
1010 rem error read routine
1020 rem ** ** ** ** ** ** ** **
1030 input#15,en,em$,et,es
1040 if en=0 then return
1050 if en=62 then goto1130
1060 print "";em$
1070 print " see your drive manual for the specfic "
1080 print " error condition for number [158]";en
1090 close5:close15
1100 ti$ ="000000"
1110 if ti$ < "000008" then goto1110
1120 goto230
1130 print " file not started "
1140 print " please enter data on next screen "
1150 ti$ ="000000"
1160 if ti$ < "000008" then goto1160
1170 close5:close15
1180 return
1190 rem
1200 :
1210 open15,4,15:close15:if(st=.)then1218
1212 print" [150]printer not online![145]"
1214 fora=1to55:poke54296,15:poke54296,.:next
1216 print" [145]":return
1218 print" [154]printing -- please wait.[145]"
1219 open1,3:open2,4,7:print#1,chr$(19);
1220 for m=1 to 23:a$=" "
1230 forl=1to40:get#1,b$:a$=a$+b$:next
1240 r$=chr$(13):if b$=r$ then1260
1250 print#2,a$:next m:goto1270
1260 print#2,a$;:next m
1270 print#2:close 2:print#1:close 1
1275 print" [145]"
1280 return
1290 rem
1300 rem ** ** ** ** ** ** ** **
1310 print""
1320 printtab(16)"loadstar"
1330 printtab(16)"presents"
1340 print" calorie "
1350 print" selector "
1360 print" program"
1370 print"[158] by"
1380 print" richard melanson"
1390 print" copyright 1987"
1400 ti$ ="000000"
1410 if ti$ < "000002" then goto1410
1420 rem
1430 rem ** ** ** ** ** ** ** **
1440 gosub310
1450 print"[158] "
1460 print" calorie selector "
1470 print"[158] "
1480 print" function selection "
1490 print"[158]f. food files[158]"
1500 print" add,change,or[160]review"
1510 print" your food files"
1520 print" make selections"
1530 print" for a daily meal menu"
1540 print"m. menu review[158]"
1550 print" review, or save the"
1560 print" current work menu"
1570 print"g. general[160]information[158]"
1580 print"q. quit[158] program"
1590 print"[145][159]input function letter"
1600 rp$="":poke198,.
1610 get rp$:if rp$=""then goto1610
1620 if rp$ ="f" then goto1800
1630 if rp$ ="m" then goto3970
1640 if rp$ ="3" then goto1710
1650 if rp$ ="4" then goto1710
1660 if rp$ ="5" then goto1710
1670 if rp$ ="6" then goto1710
1680 if rp$ ="g" then goto4900
1690 if rp$ ="q" then1745
1700 rem ** ** ** ** ** ** ** **
1710 print"[145] not defined "
1720 ti$ ="000000"
1730 if ti$ < "000001" then goto1730
1740 goto1450
1745 print"[147] are you absolutely, positively"
1746 print" sure you want to quit? (y[159]/n[159])"
1747 geta$:ifa$<>"y"anda$<>"n"then1747
1748 ifa$="n"then1440
1750 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
1760 ifer<>63thenend
1770 poke.,47:load"hello connect",8
1780 rem
1790 rem ** ** ** ** ** ** ** **
1800 gosub310
1810 print"[158] "
1820 print" calorie selector "
1830 print"[158] food "
1840 print" group selection "
1850 print"1. [158]starch groups"
1860 print"2. [158]protein items"
1870 print"3. [158]fruit items"
1880 print"4. [158]vegetables"
1890 print"5. [158]fast foods"
1900 print"6. [158]fat items"
1910 print"7. [158]free items"
1920 print"8. [158]mixed foods"
1930 print"g. general information"
1940 print"r. back to function screen"
1950 print"[145][159]input group number"
1960 rp$=""
1970 get rp$:if rp$=""then goto1970
1980 if rp$ ="1" then goto2150
1990 if rp$ ="2" then goto2560
2000 if rp$ ="3" then goto2570
2010 if rp$ ="4" then goto2580
2020 if rp$ ="5" then goto2590
2030 if rp$ ="6" then goto2600
2040 if rp$ ="7" then goto2610
2050 if rp$ ="8" then goto2620
2060 if rp$ ="r" then goto1440
2070 if rp$ ="g" then goto4900
2080 rem ** ** ** ** ** ** ** **
2090 print"[145] not defined "
2100 ti$ ="000000"
2110 if ti$ < "000002" then goto2110
2120 goto1810
2130 rem
2140 rem ** ** ** ** ** ** ** **
2150 gosub310
2160 print"[158] "
2170 print" calorie selector "
2180 print"[158] food "
2190 print" starch selection "
2200 print"1. [158]breads"
2210 print"2. [158]cereals"
2220 print"3. [158]pastas"
2230 print"4. [158]cookies"
2240 print"5. [158]deserts"
2250 print"6. [158]crackers"
2260 print"7. [158]vegetables"
2270 print"q. back to group selection"
2280 print""
2290 print""
2300 print"[145][159]input starch number"
2310 rp$=""
2320 get rp$:if rp$=""then goto2320
2330 if rp$ ="1" then goto2490
2340 if rp$ ="2" then goto2500
2350 if rp$ ="3" then goto2510
2360 if rp$ ="4" then goto2520
2370 if rp$ ="5" then goto2530
2380 if rp$ ="6" then goto2540
2390 if rp$ ="7" then goto2550
2400 if rp$ ="q" then1800
2410 rem ** ** ** ** ** ** ** **
2420 print"[145] not defined "
2430 ti$ ="000000"
2440 if ti$ < "000002" then goto2440
2450 goto2160
2460 rem
2470 rem ** ** ** ** ** ** ** **
2480 rem
2490 nf$="breads":goto2650
2500 nf$="cereals":goto2650
2510 nf$="pasta":goto2650
2520 nf$="cookies":goto2650
2530 nf$="dessert":goto2650
2540 nf$="crackers":goto2650
2550 nf$="stch-veget":goto2650
2560 nf$="protein":goto2650
2570 nf$="fruit":goto2650
2580 nf$="vegetable":goto2650
2590 nf$="fast-foods":goto2650
2600 nf$="fat-items":goto2650
2610 nf$="free-items":goto2650
2620 nf$="mixed-foods":goto2650
2630